PHREEQC from Scratch #4: Calcite–CO₂ Interaction (Open vs. Closed Systems)

Simulate the reaction between soil CO₂, pure water, and calcite in both open and closed systems. We quantitatively demonstrate how CO₂ availability influences pH and dissolved Ca²⁺ concentrations in groundwater formation.
Geochemistry
PHREEQC
Groundwater
English
Author

DeepFlow

Published

April 10, 2026

Introduction: Why This Reaction Matters

In the study of groundwater geochemistry, the interaction between calcite (calcium carbonate) and CO₂-charged water is perhaps the most fundamental and significant process.

As rainwater infiltrates through the soil, it absorbs CO₂ produced by biological activity, becoming slightly acidic. When this acidic water comes into contact with carbonate rocks (such as limestone), calcite dissolves, releasing \(\mathrm{Ca^{2+}}\) and \(\mathrm{HCO_3^-}\) into the water. This is the primary reason why much of the world’s groundwater is “hard water.”

Crucially, the progression of this reaction depends heavily on whether the system is “open” or “closed” to CO₂ gas.

Two Scenarios Compared in This Tutorial
Open System
Constant equilibrium with CO₂ gas. CO₂ is continuously replenished during the reaction. Typical of the soil zone.
Closed System
Water is equilibrated with CO₂ and then isolated from the gas phase. Typical of deep, confined aquifers.

Chemical Equations

Let’s summarize the chemistry involved in this system.

Dissolution of CO₂:

\[\mathrm{CO_2(g) + H_2O \rightleftharpoons H_2CO_3^* \rightleftharpoons H^+ + HCO_3^-}\]

Dissolution of Calcite:

\[\mathrm{CaCO_3 + H^+ \rightleftharpoons Ca^{2+} + HCO_3^-}\]

Net Reaction (Open System):

\[\mathrm{CaCO_3 + CO_2(g) + H_2O \rightleftharpoons Ca^{2+} + 2HCO_3^-}\]

  • \(\mathrm{H_2CO_3^*}\): Sum of dissolved \(\mathrm{CO_2(aq)}\) and true carbonic acid \(\mathrm{H_2CO_3}\) \([mol/kg]\)
  • \(\mathrm{CaCO_3}\): Calcite (solid phase)
  • \(\mathrm{CO_2(g)}\): Carbon dioxide in the gas phase

In an open system, the continuous supply of CO₂ drives the reaction to the right, promoting dissolution. In a closed system, the limited amount of dissolved CO₂ is quickly consumed, often resulting in a higher final pH and lower mineral dissolution.


Setting the Partial Pressure of CO₂

The partial pressure of CO₂ (\(P_{CO_2}\)) in soil can reach 30 to 100 times that of the atmosphere. In this tutorial, we will use a representative value:

\[P_{CO_2} = 10^{-1.5} \approx 0.032 \text{ atm}\]

This is a typical value for soil in limestone regions (roughly 100 times the atmospheric value of \(10^{-3.5}\) atm).

In PHREEQC, CO₂ gas is identified as CO2(g). By writing CO2(g) -1.5 in the EQUILIBRIUM_PHASES block, we specify the condition \(\log P_{CO_2} = -1.5\).


Configuration of Simulation Scenarios

Scenario CO₂ Condition Calcite Condition PHREEQC Block
Open System Constant equilibrium with CO₂(g)
(P = 10⁻¹·⁵ atm)
Calcite (SI=0, 10 mol) SOLUTION 1
EQUILIBRIUM_PHASES 1
(Simultaneous CO2 + Calcite)
Closed System Pre-equilibrate with CO₂(g)
→ Then isolate from gas
Separate EQ_PHASES for
Calcite only
SOLUTION 2
EQUILIBRIUM_PHASES 1
SAVE → USE
EQUILIBRIUM_PHASES 2

GUI Procedure

Open System Configuration

Step 1: Define pure water (SOLUTION 1).

Step 2: Click the EQUILIBRIUM_PHASES icon and set the following: - CO2(g): Target SI = -1.5, Amount = 10 - Calcite: Target SI = 0, Amount = 10

NoteMeaning of Target SI = -1.5 for CO2(g)

The instruction CO2(g) -1.5 means “dissolve CO₂ until the water reaches equilibrium with \(\log P_{CO_2} = -1.5\).” In an open system, CO₂ is maintained at this partial pressure throughout the reaction.


Closed System Configuration

A closed system is simulated in two stages:

Stage 1: Dissolve CO₂ (Gas phase present) Define SOLUTION 2, equilibrate with CO₂ only using EQUILIBRIUM_PHASES, and save the state using SAVE solution 2.

Stage 2: React with Calcite (No gas phase) Use USE solution 2 to recall the carbonated water, then equilibrate with Calcite only in a new EQUILIBRIUM_PHASES block. Do not include CO2(g) in this second block.


Full PHREEQC Code

# ===================================
# Open System
# Simultaneous equilibrium with CO2 and Calcite
# ===================================
SOLUTION 1  Open system - Pure water
    temp      25
    pH        7
    pe        4
    redox     pe
    units     mmol/kgw
    density   1
    -water    1 # kg

EQUILIBRIUM_PHASES 1
    CO2(g)   -1.5   10   # log P(CO2) = -1.5 atm, constant supply
    Calcite   0     10   # Equilibrium with calcite

END

# ===================================
# Closed System
# Stage 1: Initial CO2 dissolution
# ===================================
SOLUTION 2  Closed system - Pure water
    temp      25
    pH        7
    pe        4
    redox     pe
    units     mmol/kgw
    density   1
    -water    1 # kg

EQUILIBRIUM_PHASES 1
    CO2(g)   -1.5   10   # Equilibrate with CO2 only (no calcite yet)

SAVE solution 2          # Save water after CO2 dissolution

END

# ===================================
# Closed System Stage 2:
# Reaction with Calcite after isolation from gas
# ===================================
USE solution 2           # Use the saved carbonated water

EQUILIBRIUM_PHASES 2
    Calcite   0     10   # Equilibrate with calcite only (no gas phase)

END
ImportantUnderstanding SAVE and USE

The SAVE solution 2 command stores the current state of the water (pH, ion concentrations, temperature, etc.) in memory. USE solution 2 recalls that state for further calculations. This is essential for simulating “step-wise reactions” like the closed system scenario.


Reading the Results

After running the calculation, you can compare the outputs for the two scenarios.

Open System Results (SOLUTION 1 after)

pH                 =   6.97
Ca²⁺ (mol/kgw)    =   2.39e-03
HCO₃⁻ (mol/kgw)  =   4.88e-03
Calcite SI        =   0.00     ← Equilibrium reached
CO2(g) SI         =   -1.5     ← CO2(g) maintained at -1.5

Closed System Results (SOLUTION 2 after Stage 2)

pH                 =   7.68
Ca²⁺ (mol/kgw)    =   9.94e-04
HCO₃⁻ (mol/kgw)  =   1.99e-03
Calcite SI        =   0.00     ← Equilibrium reached
CO2(g) SI         =  -2.58     ← CO2 is undersaturated (consumed)

Comparison Summary

Parameter Open System Closed System
Final pH 6.97 7.68
Ca²⁺ Concentration 2.39×10⁻³ mol/kg
≈ 96 mg/L
9.94×10⁻⁴ mol/kg
≈ 40 mg/L
HCO₃⁻ Concentration 4.88×10⁻³ mol/kg 1.99×10⁻³ mol/kg
Calcite Dissolved High (~2.5x) Low
CO₂(g) SI -1.5 (Input condition) −2.58 (Consumed)

Discussion

1. Why the Open System has a Lower pH

In an open system, CO₂ is maintained at \(P_{CO_2} = 10^{-1.5}\) atm. Even as calcite dissolves and consumes \(\mathrm{H^+}\), additional CO₂ is supplied from the gas phase to regenerate \(\mathrm{H^+}\). This maintains the acidity and promotes further dissolution of calcite. Consequently, the final Calcium concentration (2.39×10⁻³ mol/kgw) is significantly higher than in the closed system.

\[\mathrm{CO_2(g) \rightarrow CO_2(aq) \rightarrow H^+ + HCO_3^- \xrightarrow{Calcite} Ca^{2+} + 2HCO_3^-}\]

2. Why the Closed System has a Higher pH

In a closed system, the amount of CO₂ dissolved in Stage 1 is the total available carbon. As calcite dissolves, \(\mathrm{H^+}\) is consumed. However, because the system is isolated, there is no new supply of CO₂. The acidity is quickly neutralized, the solution pH rises, and the reaction halts much earlier.

3. Application to Natural Groundwater

TipWhich System is More Realistic?

Natural groundwater systems often transition between these two states: - Soil Zone (Shallow): Rich in soil CO₂ with constant replenishment → Approaches an Open System. - Deep Aquifers: Isolated from the atmosphere and soil gas → Approaches a Closed System.

As groundwater moves deeper, it often becomes more alkaline (higher pH) and can become supersaturated with respect to calcite. In cave environments, when this deep groundwater emerges and comes into contact with low-CO₂ air, it “degasses” CO₂, causing calcite to precipitate and form speleothems like stalagmites.


Key Mechanism Comparison

Open System Mechanism
CO₂ Supply → H⁺ Generation → Calcite Dissolution → H⁺ Consumption → CO₂ Supply → ... (Cycle)
→ Dissolution continues to equilibrium at constant P_CO2.
Closed System Mechanism
Dissolved CO₂ (Limited) → H⁺ Generation → Calcite Dissolution → H⁺ Consumption → CO₂ Depletion → Stop
→ Reaction stops once initial CO₂ is exhausted.

Next Time: Mixing Groundwater and Seawater

In the next tutorial, we will calculate what happens when carbonated groundwater (from limestone areas) meets seawater.

We will explore the phenomenon of “Mixing Corrosion”—where the simple mixture of two calcite-saturated solutions becomes undersaturated (corrosive). This process is vital for understanding the formation of coastal limestone caves.


References

Appelo, CAJ, and Dieke Postma. 2005. Geochemistry, Groundwater and Pollution. Second. Balkema, Rotterdam, p. 634.
Parkhurst, David L, and CAJ Appelo. 2013. Description of Input and Examples for PHREEQC Version 3—a Computer Program for Speciation, Batch-Reaction, One-Dimensional Transport, and Inverse Geochemical Calculations. US Geological Survey Techniques; Methods, book 6, chap. A43, 497 p.
Yamamoto, S. 1983. Method of the Groundwater Survey. Kokon Shoin, Tokyo (in Japanese), 490 p.
Yang, Heejun, T Mishima, S Katazakai, and M Kagabu. 2023. “Analytical Approach Using a Chemical Equilibrium Formula and Geochemical Modeling for Alkalinity Measurements of Small Natural Water Samples.” Applied Geochemistry 148: 105535.

Other articles in this series:


DeepFlow | Science beneath the surface